#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<assert.h>
void swap(char *a,int k)
{
	assert(a);
	int len = strlen(a);
	int pos = k % len;
	char tmp[256] = { 0 };

	strcpy(tmp, a + pos);
	strncat(tmp, a, pos);
	strcpy(a, tmp);
}
int main()
{
	int k = 0;
	scanf("%d", &k);
	char a[] = "AABCD";
	printf("%s\n", a);
	swap(a, k);
	printf("%s\n", a);
	return 0;
}

